<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <button onclick="areas()">点我</button>
    <script>
        function areas(){
            var r = prompt("请输入圆半径");
            var areas = r*r*Math.PI;
            document.write("圆面积为:"+areas);
        }
    </script>
</body>
</html>